/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>CreateTime: 2006-4-6 </p>
 * @author pengz
 * @version 1.0
 */

package cn.agiledata.bank.myspace.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.*;

public class ModifyPayPassForm extends ActionForm {
	public String pass, newPass, reNewPass;

	public String getNewPass() {
		return newPass;
	}

	public void setNewPass(String newPass) {
		this.newPass = newPass;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public String getReNewPass() {
		return reNewPass;
	}

	public void setReNewPass(String reNewPass) {
		this.reNewPass = reNewPass;
	}

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		ActionMessage amm = new ActionMessage("pass is whrong");

		if (newPass == null || newPass.length() == 0) {
			errors.add("mailerrors", amm);
			return errors;
		}
		if (reNewPass == null || reNewPass.length() == 0) {
			errors.add("mailerrors", amm);
			return errors;
		}
		if (!reNewPass.equals(newPass)) {
			errors.add("mailerrors", amm);
			return errors;
		}

		return null;

	}
}
